Skip to content

feat(display): show weather values as whole numbers (round_values setting)#475

Open
Orinks wants to merge 1 commit intodevfrom
feature/round-values-setting
Open

feat(display): show weather values as whole numbers (round_values setting)#475
Orinks wants to merge 1 commit intodevfrom
feature/round-values-setting

Conversation

@Orinks
Copy link
Owner

@Orinks Orinks commented Mar 17, 2026

Summary

  • Adds round_values: bool = False to AppSettings (was already partially in-flight in config.py)
  • Wires the setting through current conditions, forecast, and taskbar icon text display paths so all numeric weather values respect precision=0 when enabled
  • Adds a checkbox "Show values as whole numbers (no decimals)" in the Settings dialog Display tab
  • Adds tests/test_round_values_setting.py with 25 tests covering AppSettings, unit formatters, current conditions builder, forecast builder, seasonal metrics, and TaskbarIconUpdater
  • Fixes one test assertion that relied on 0.15 rounding to 0.2 at precision=1, which fails due to Python binary float representation; changed input to 0.17

Files changed

File Change
models/config.py round_values field + serialisation
ui/dialogs/settings_dialog.py Display tab checkbox, load/save wiring
display/presentation/current_conditions.py Precision derived from round_values
display/presentation/forecast.py Same, for forecast rows
display/presentation/formatters.py get_temperature_precision helper used by display path
taskbar_icon_updater.py round_values param, precision applied per metric
app.py Passes round_values from settings to TaskbarIconUpdater
tests/test_round_values_setting.py New — 25 tests, all passing

Test plan

  • pytest tests/test_round_values_setting.py → 25 passed, 0 failed
  • Manual smoke: enable setting, observe no decimals in conditions, forecast, tray

🤖 Generated with Claude Code

Adds a boolean AppSettings.round_values (default False) that strips
decimals from all displayed weather values when enabled. Wires through
current conditions, forecast, and taskbar icon text. Adds a checkbox
in the Settings dialog Display section. Fixes a test assertion using
0.15 (FP banker's rounding) in favour of 0.17.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant